# 导入模块

from rest_framework.routers import DefaultRouter
from app01.views import SensorViewSet,ProjectViewSet,DataViewSet,DrawingViewSet

# 1实例化一个DefaultRouter
router = DefaultRouter()

# 2注册相应的url
# 注册Sensor对象
router.register('Sensors',SensorViewSet,basename='Sensors') # http://127.0.0.1:8080/DrawingApi/v1/Sensors/
# 注册Projects对象
router.register('Projects', ProjectViewSet, basename='Projects') # http://127.0.0.1:8080/DrawingApi/v1/Projects/
# 注册Datas对象
router.register('Datas', DataViewSet, basename='Datas') # http://127.0.0.1:8080/DrawingApi/v1/Datas/
# 注册Drawings对象
router.register('Drawings', DrawingViewSet, basename='Drawings') # http://127.0.0.1:8080/DrawingApi/v1/Drawings/

urlpatterns = [
    
]

# 3附加到urlpatterns集合中
urlpatterns += router.urls

